﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the Xcoordination Application Space
 * ("XcoAppSpace") http://www.xcoordination.com
 *
 * Copyright (C) 2009 Xcoordination http://www.xcoordination.com
 *
 * XcoAppSpace is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General
 * Public License as published by the Free Software Foundation.
 *
 * XcoAppSpace is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ---------------------------------------------------------------- */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Ccr.Core;

namespace XcoAppSpaces.Contracts.CcrExtensions
{
	/// <summary>
	/// Interface definition for a remotable ccr task (a ccr task that can send messages to a remote ccr port or portset).
	/// </summary>
    public interface IRemotableTask
    {
		/// <summary>
		/// The remote address of the original port or portset.
		/// </summary>
        string RemoteAddress { get; }

		/// <summary>
		/// The name of the transport service that should be used to send messages.
		/// </summary>
        string CommServiceName { get; }

		/// <summary>
		/// The id of the original port or portset.
		/// </summary>
        Guid PortGuid { get; }

		/// <summary>
		/// Directly sends the given item using the tasks remote address and transport service name.
		/// </summary>
		/// <param name="item">The item to be sent.</param>
		/// <param name="commErrorPort">Optional port where communication errors should be posted back.</param>
		/// <param name="commAckPort">Optional port where communication ACK should be posted back.</param>
		void Send(object item, Port<Exception> commErrorPort, IPort commAckPort);
    }
}
